-- phpMyAdmin SQL Dump
-- version 3.5.2
-- http://www.phpmyadmin.net
--
-- 主机: hpc08.sys.zzbc.qihoo.net
-- 生成日期: 2012 年 09 月 21 日 14:41
-- 服务器版本: 5.1.65-log
-- PHP 版本: 5.2.10

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- 数据库: `dw`
--

-- --------------------------------------------------------

--
-- 表的结构 `activity`
--

DROP TABLE IF EXISTS `activity`;
CREATE TABLE IF NOT EXISTS `activity` (
  `activity_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `activity_name` varchar(256) COLLATE utf8_bin NOT NULL,
  `activity_type` tinyint(3) unsigned NOT NULL,
  `programs` varchar(2048) COLLATE utf8_bin DEFAULT NULL,
  `retry_times` tinyint(3) unsigned NOT NULL DEFAULT '3',
  `inputs` varchar(2048) COLLATE utf8_bin DEFAULT NULL,
  `outputs` varchar(2048) COLLATE utf8_bin DEFAULT NULL,
  `params` varchar(2048) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`activity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `command`
--

DROP TABLE IF EXISTS `command`;
CREATE TABLE IF NOT EXISTS `command` (
  `cmd_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `cmd_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `task_id` bigint(20) unsigned NOT NULL,
  `cmd_param` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  `submit_time` datetime NOT NULL,
  `accept_time` datetime DEFAULT NULL,
  `detail` varchar(256) COLLATE utf8_bin DEFAULT NULL,
  `state` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`cmd_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `execution`
--

DROP TABLE IF EXISTS `execution`;
CREATE TABLE IF NOT EXISTS `execution` (
  `execution_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `execution_next_thread_id` bigint(20) NOT NULL DEFAULT '0',
  `execution_parent` bigint(20) DEFAULT NULL,
  `execution_started` bigint(20) NOT NULL DEFAULT '0',
  `execution_suspended` bigint(20) DEFAULT NULL,
  `execution_threads` longblob,
  `execution_variables` longblob,
  `execution_waiting_for` longblob,
  `workflow_id` bigint(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`execution_id`),
  KEY `execution_parent` (`execution_parent`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `execution_state`
--

DROP TABLE IF EXISTS `execution_state`;
CREATE TABLE IF NOT EXISTS `execution_state` (
  `execution_id` bigint(20) NOT NULL DEFAULT '0',
  `node_activated_from` longblob,
  `node_id` bigint(20) NOT NULL DEFAULT '0',
  `node_state` longblob,
  `node_thread_id` bigint(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`execution_id`,`node_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- 表的结构 `executor_machine`
--

DROP TABLE IF EXISTS `executor_machine`;
CREATE TABLE IF NOT EXISTS `executor_machine` (
  `executor_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `hostname` varchar(128) COLLATE utf8_bin NOT NULL,
  `max_workers` int(10) unsigned NOT NULL,
  `current_workers` int(10) unsigned NOT NULL DEFAULT '0',
  `state` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`executor_id`),
  UNIQUE KEY `hostname` (`hostname`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=3 ;

--
-- 转存表中的数据 `executor_machine`
--

INSERT INTO `executor_machine` (`executor_id`, `hostname`, `max_workers`, `current_workers`, `state`) VALUES
(1, 'hpc08.sys.zzbc.qihoo.net', 10, 0, 0),
(2, 'hpc09.sys.zzbc.qihoo.net', 10, 0, 0);

-- --------------------------------------------------------

--
-- 表的结构 `job`
--

DROP TABLE IF EXISTS `job`;
CREATE TABLE IF NOT EXISTS `job` (
  `job_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `job_name` varchar(256) COLLATE utf8_bin NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `job_type` tinyint(3) unsigned NOT NULL,
  `job_frequency` smallint(5) unsigned NOT NULL,
  `job_priority` tinyint(3) unsigned NOT NULL,
  `job_param` varchar(1024) COLLATE utf8_bin NOT NULL,
  `workflow_name` varchar(256) COLLATE utf8_bin DEFAULT NULL,
  `submit_time` datetime NOT NULL,
  `trigger_param` varchar(1024) COLLATE utf8_bin NOT NULL,
  `state` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `node`
--

DROP TABLE IF EXISTS `node`;
CREATE TABLE IF NOT EXISTS `node` (
  `node_class` varchar(255) NOT NULL,
  `node_configuration` longblob,
  `node_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `workflow_id` bigint(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`node_id`),
  KEY `workflow_id` (`workflow_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `node_connection`
--

DROP TABLE IF EXISTS `node_connection`;
CREATE TABLE IF NOT EXISTS `node_connection` (
  `incoming_node_id` bigint(20) NOT NULL DEFAULT '0',
  `node_connection_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `outgoing_node_id` bigint(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`node_connection_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `product`
--

DROP TABLE IF EXISTS `product`;
CREATE TABLE IF NOT EXISTS `product` (
  `product_id` int(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_name` varchar(1024) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`product_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ;

--
-- 转存表中的数据 `product`
--

INSERT INTO `product` (`product_id`, `product_name`) VALUES
(1, 'search');

-- --------------------------------------------------------

--
-- 表的结构 `resource`
--

DROP TABLE IF EXISTS `resource`;
CREATE TABLE IF NOT EXISTS `resource` (
  `res_id` bigint(10) unsigned NOT NULL AUTO_INCREMENT,
  `res_name` varchar(256) COLLATE utf8_bin NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `res_type` tinyint(3) unsigned NOT NULL,
  `res_frequency` int(10) unsigned NOT NULL DEFAULT '1440',
  `res_desc` varchar(1024) COLLATE utf8_bin NOT NULL,
  `quality_level` tinyint(3) unsigned DEFAULT '0',
  `job_id` bigint(20) unsigned NULL,
  PRIMARY KEY (`res_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `resource_partition`
--

DROP TABLE IF EXISTS `resource_partition`;
CREATE TABLE IF NOT EXISTS `resource_partition` (
  `partition_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `physical_id` bigint(10) unsigned NOT NULL,
  `partition` varchar(1024) COLLATE utf8_bin NOT NULL,
  `size` bigint(20) unsigned NOT NULL,
  `count` bigint(20) unsigned NOT NULL,
  `create_time` datetime NOT NULL,
  `schema` varchar(5000) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`partition_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `resource_physical`
--

DROP TABLE IF EXISTS `resource_physical`;
CREATE TABLE IF NOT EXISTS `resource_physical` (
  `physical_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `physical_name` varchar(256) COLLATE utf8_bin NOT NULL,
  `res_id` bigint(20) unsigned NOT NULL,
  `physical_type` tinyint(3) unsigned NOT NULL,
  `storage` varchar(1024) COLLATE utf8_bin NOT NULL,
  `partition_format` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT 'Ymd/Hi',
  `system_id` int(10) unsigned NOT NULL,
  `keep_days` int(10) unsigned NOT NULL,
  PRIMARY KEY (`physical_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `result`
--

DROP TABLE IF EXISTS `result`;
CREATE TABLE IF NOT EXISTS `result` (
  `result_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `task_id` bigint(20) unsigned NOT NULL,
  `result_fp` varchar(1024) COLLATE utf8_bin NOT NULL,
  `fp_md5` varchar(32) COLLATE utf8_bin DEFAULT NULL,
  `hive_table` varchar(256) COLLATE utf8_bin DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`result_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `result_detail`
--

DROP TABLE IF EXISTS `result_detail`;
CREATE TABLE IF NOT EXISTS `result_detail` (
  `record_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `result_id` bigint(20) unsigned NOT NULL,
  `content` varchar(5000) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`record_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `schedule`
--

DROP TABLE IF EXISTS `schedule`;
CREATE TABLE IF NOT EXISTS `schedule` (
  `date` datetime NOT NULL,
  PRIMARY KEY (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

--
-- 转存表中的数据 `schedule`
--

INSERT INTO `schedule` (`date`) VALUES
('2012-09-13 23:50:00');

-- --------------------------------------------------------

--
-- 表的结构 `schedule_control`
--

DROP TABLE IF EXISTS `schedule_control`;
CREATE TABLE IF NOT EXISTS `schedule_control` (
  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
  `suspend` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ;

--
-- 转存表中的数据 `schedule_control`
--

INSERT INTO `schedule_control` (`id`, `suspend`) VALUES
(1, 0);

-- --------------------------------------------------------

--
-- 表的结构 `storage_system`
--

DROP TABLE IF EXISTS `storage_system`;
CREATE TABLE IF NOT EXISTS `storage_system` (
  `system_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `host_name` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  `port` varchar(10) COLLATE utf8_bin DEFAULT NULL,
  `user_name` varchar(128) COLLATE utf8_bin DEFAULT NULL,
  `password` varchar(128) COLLATE utf8_bin DEFAULT NULL,
  `storage_type` tinyint(3) unsigned NOT NULL,
  `namespace` varchar(1024) COLLATE utf8_bin NOT NULL,
  `client_home` varchar(128) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`system_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=3 ;

--
-- 转存表中的数据 `storage_system`
--

INSERT INTO `storage_system` (`system_id`, `host_name`, `port`, `user_name`, `password`, `storage_type`, `namespace`, `client_home`) VALUES
(1, 'w-namenode.safe.zzbc.qihoo.net', '9000', 'qss,supergroup', '', 0, '/', '/home/work/software/hadoop'),
(2, 'w-namenode.safe.zzbc.qihoo.net', '9000', 'qss,supergroup', '', 1, '/user/hive/warehouse', '/home/work/software/hive');

-- --------------------------------------------------------

--
-- 表的结构 `task`
--

DROP TABLE IF EXISTS `task`;
CREATE TABLE IF NOT EXISTS `task` (
  `task_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `job_id` bigint(20) NOT NULL,
  `date` datetime NOT NULL,
  `cmd_id` bigint(20) unsigned DEFAULT NULL,
  `task_type` tinyint(3) unsigned NOT NULL,
  `frequency` smallint(11) unsigned NOT NULL,
  `priority` tinyint(3) unsigned NOT NULL,
  `workflow_name` varchar(256) COLLATE utf8_bin NOT NULL,
  `executor_id` int(10) unsigned DEFAULT NULL,
  `execution_id` int(10) unsigned DEFAULT NULL,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `runtime_info` varchar(5000) COLLATE utf8_bin DEFAULT NULL,
  `state` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `detail` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`task_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- 表的结构 `user`
--

DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user` (
  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_name` varchar(128) COLLATE utf8_bin NOT NULL,
  `password` varchar(128) COLLATE utf8_bin NOT NULL,
  `role` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=3 ;

--
-- 转存表中的数据 `user`
--

INSERT INTO `user` (`user_id`, `user_name`, `password`, `role`) VALUES
(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 1),
(2, 'shupeng', '0493dec4b597b4886834be5ab5b95866', 1);

-- --------------------------------------------------------

--
-- 表的结构 `variable_handler`
--

DROP TABLE IF EXISTS `variable_handler`;
CREATE TABLE IF NOT EXISTS `variable_handler` (
  `class` varchar(255) NOT NULL,
  `variable` varchar(255) NOT NULL,
  `workflow_id` bigint(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`class`,`workflow_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- 表的结构 `workflow`
--

DROP TABLE IF EXISTS `workflow`;
CREATE TABLE IF NOT EXISTS `workflow` (
  `workflow_created` bigint(20) NOT NULL DEFAULT '0',
  `workflow_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `workflow_name` varchar(255) NOT NULL,
  `workflow_version` bigint(20) NOT NULL DEFAULT '1',
  PRIMARY KEY (`workflow_id`),
  UNIQUE KEY `name_version` (`workflow_name`,`workflow_version`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
